<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta charset="utf-8" />
	<title>margin-top问题</title>
	<style>
		.d1{
			width: 200px;
			height: 200px;
			background-color: bisque;


			/* 解决办法 */
			border: 1px solid red; /*方法1：设置border*/
			overflow: hidden;	/*触发BFC*/
		}

		.d2{
			width: 100px;
			height: 100px;
			background-color: brown;

			margin-top: 20px;
		}

	</style>
</head>

<body>
	<div class="d1">
		<div class="d2">
		</div>
	</div>


</body>

</html>